<html>
<head>
<meta http-equiv="Content-Type" content="text/html; charset=UTF-8">
<title>strategy::buffer::point_circle</title>
<link rel="stylesheet" href="../../../../../../../doc/src/boostbook.css" type="text/css">
<meta name="generator" content="DocBook XSL Stylesheets V1.79.1">
<link rel="home" href="../../../index.html" title="Chapter 1. Geometry">
<link rel="up" href="../strategies.html" title="Strategies">
<link rel="prev" href="strategy_buffer_distance_asymmetric.html" title="strategy::buffer::distance_asymmetric">
<link rel="next" href="strategy_buffer_point_square.html" title="strategy::buffer::point_square">
</head>
<body bgcolor="white" text="black" link="#0000FF" vlink="#840084" alink="#0000FF">
<table cellpadding="2" width="100%"><tr>
<td valign="top"><img alt="Boost C++ Libraries" width="277" height="86" src="../../../../../../../boost.png"></td>
<td align="center"><a href="../../../../../../../index.html">Home</a></td>
<td align="center"><a href="../../../../../../../libs/libraries.htm">Libraries</a></td>
<td align="center"><a href="http://www.boost.org/users/people.html">People</a></td>
<td align="center"><a href="http://www.boost.org/users/faq.html">FAQ</a></td>
<td align="center"><a href="../../../../../../../more/index.htm">More</a></td>
</tr></table>
<hr>
<div class="spirit-nav">
<a accesskey="p" href="strategy_buffer_distance_asymmetric.html"><img src="../../../../../../../doc/src/images/prev.png" alt="Prev"></a><a accesskey="u" href="../strategies.html"><img src="../../../../../../../doc/src/images/up.png" alt="Up"></a><a accesskey="h" href="../../../index.html"><img src="../../../../../../../doc/src/images/home.png" alt="Home"></a><a accesskey="n" href="strategy_buffer_point_square.html"><img src="../../../../../../../doc/src/images/next.png" alt="Next"></a>
</div>
<div class="section">
<div class="titlepage"><div><div><h4 class="title">
<a name="geometry.reference.strategies.strategy_buffer_point_circle"></a><a class="link" href="strategy_buffer_point_circle.html" title="strategy::buffer::point_circle">strategy::buffer::point_circle</a>
</h4></div></div></div>
<p>
          <a class="indexterm" name="idm45246411599840"></a><a class="indexterm" name="idm45246411599152"></a><a class="indexterm" name="idm45246411598464"></a>
Create a circular buffer around a point.
        </p>
<h6>
<a name="geometry.reference.strategies.strategy_buffer_point_circle.h0"></a>
          <span class="phrase"><a name="geometry.reference.strategies.strategy_buffer_point_circle.description"></a></span><a class="link" href="strategy_buffer_point_circle.html#geometry.reference.strategies.strategy_buffer_point_circle.description">Description</a>
        </h6>
<p>
          This strategy can be used as PointStrategy for the buffer algorithm. It
          creates a circular buffer around a point. It can be applied for points
          and multi_points, but also for a linestring (if it is degenerate, so consisting
          of only one point) and for polygons (if it is degenerate). This strategy
          is only applicable for Cartesian coordinate systems.
        </p>
<h6>
<a name="geometry.reference.strategies.strategy_buffer_point_circle.h1"></a>
          <span class="phrase"><a name="geometry.reference.strategies.strategy_buffer_point_circle.synopsis"></a></span><a class="link" href="strategy_buffer_point_circle.html#geometry.reference.strategies.strategy_buffer_point_circle.synopsis">Synopsis</a>
        </h6>
<p>
</p>
<pre class="programlisting"><span class="keyword">class</span> <span class="identifier">strategy</span><span class="special">::</span><span class="identifier">buffer</span><span class="special">::</span><span class="identifier">point_circle</span>
<span class="special">{</span>
  <span class="comment">// ...</span>
<span class="special">};</span>
</pre>
<p>
        </p>
<h6>
<a name="geometry.reference.strategies.strategy_buffer_point_circle.h2"></a>
          <span class="phrase"><a name="geometry.reference.strategies.strategy_buffer_point_circle.constructor_s_"></a></span><a class="link" href="strategy_buffer_point_circle.html#geometry.reference.strategies.strategy_buffer_point_circle.constructor_s_">Constructor(s)</a>
        </h6>
<div class="informaltable"><table class="table">
<colgroup>
<col>
<col>
<col>
</colgroup>
<thead><tr>
<th>
                  <p>
                    Function
                  </p>
                </th>
<th>
                  <p>
                    Description
                  </p>
                </th>
<th>
                  <p>
                    Parameters
                  </p>
                </th>
</tr></thead>
<tbody><tr>
<td>
                  <p>
</p>
<pre xmlns:rev="http://www.cs.rpi.edu/~gregod/boost/tools/doc/revision" class="table-programlisting"><span class="identifier">point_circle</span><span class="special">(</span><span class="identifier">std</span><span class="special">::</span><span class="identifier">size_t</span> <span class="identifier">count</span> <span class="special">=</span> <span class="number">90</span><span class="special">)</span></pre>
<p>
                  </p>
                </td>
<td>
                  <p>
                    Constructs the strategy.
                  </p>
                </td>
<td>
                  <p>
                    <span class="bold"><strong>std::size_t</strong></span>: <span class="emphasis"><em>count</em></span>:
                    number of points for the created circle (if count is smaller
                    than 3, count is internally set to 3)
                  </p>
                </td>
</tr></tbody>
</table></div>
<h6>
<a name="geometry.reference.strategies.strategy_buffer_point_circle.h3"></a>
          <span class="phrase"><a name="geometry.reference.strategies.strategy_buffer_point_circle.header"></a></span><a class="link" href="strategy_buffer_point_circle.html#geometry.reference.strategies.strategy_buffer_point_circle.header">Header</a>
        </h6>
<p>
          <code class="computeroutput"><span class="preprocessor">#include</span> <span class="special">&lt;</span><span class="identifier">boost</span><span class="special">/</span><span class="identifier">geometry</span><span class="special">/</span><span class="identifier">strategies</span><span class="special">/</span><span class="identifier">cartesian</span><span class="special">/</span><span class="identifier">buffer_point_circle</span><span class="special">.</span><span class="identifier">hpp</span><span class="special">&gt;</span></code>
        </p>
<h6>
<a name="geometry.reference.strategies.strategy_buffer_point_circle.h4"></a>
          <span class="phrase"><a name="geometry.reference.strategies.strategy_buffer_point_circle.example"></a></span><a class="link" href="strategy_buffer_point_circle.html#geometry.reference.strategies.strategy_buffer_point_circle.example">Example</a>
        </h6>
<p>
          Shows how the point_circle strategy can be used as a PointStrategy to create
          circular buffers around points
        </p>
<p>
</p>
<pre class="programlisting"><span class="preprocessor">#include</span> <span class="special">&lt;</span><span class="identifier">boost</span><span class="special">/</span><span class="identifier">geometry</span><span class="special">.</span><span class="identifier">hpp</span><span class="special">&gt;</span>
<span class="preprocessor">#include</span> <span class="special">&lt;</span><span class="identifier">boost</span><span class="special">/</span><span class="identifier">geometry</span><span class="special">/</span><span class="identifier">geometries</span><span class="special">/</span><span class="identifier">point_xy</span><span class="special">.</span><span class="identifier">hpp</span><span class="special">&gt;</span>
<span class="preprocessor">#include</span> <span class="special">&lt;</span><span class="identifier">boost</span><span class="special">/</span><span class="identifier">geometry</span><span class="special">/</span><span class="identifier">geometries</span><span class="special">/</span><span class="identifier">geometries</span><span class="special">.</span><span class="identifier">hpp</span><span class="special">&gt;</span>


<span class="keyword">int</span> <span class="identifier">main</span><span class="special">()</span>
<span class="special">{</span>
    <span class="keyword">typedef</span> <span class="identifier">boost</span><span class="special">::</span><span class="identifier">geometry</span><span class="special">::</span><span class="identifier">model</span><span class="special">::</span><span class="identifier">d2</span><span class="special">::</span><span class="identifier">point_xy</span><span class="special">&lt;</span><span class="keyword">double</span><span class="special">&gt;</span> <span class="identifier">point</span><span class="special">;</span>
    <span class="keyword">typedef</span> <span class="identifier">boost</span><span class="special">::</span><span class="identifier">geometry</span><span class="special">::</span><span class="identifier">model</span><span class="special">::</span><span class="identifier">polygon</span><span class="special">&lt;</span><span class="identifier">point</span><span class="special">&gt;</span> <span class="identifier">polygon</span><span class="special">;</span>

    <span class="comment">// Declare the point_circle strategy</span>
    <span class="identifier">boost</span><span class="special">::</span><span class="identifier">geometry</span><span class="special">::</span><span class="identifier">strategy</span><span class="special">::</span><span class="identifier">buffer</span><span class="special">::</span><span class="identifier">point_circle</span> <span class="identifier">point_strategy</span><span class="special">(</span><span class="number">360</span><span class="special">);</span>

    <span class="comment">// Declare other strategies</span>
    <span class="identifier">boost</span><span class="special">::</span><span class="identifier">geometry</span><span class="special">::</span><span class="identifier">strategy</span><span class="special">::</span><span class="identifier">buffer</span><span class="special">::</span><span class="identifier">distance_symmetric</span><span class="special">&lt;</span><span class="keyword">double</span><span class="special">&gt;</span> <span class="identifier">distance_strategy</span><span class="special">(</span><span class="number">0.7</span><span class="special">);</span>
    <span class="identifier">boost</span><span class="special">::</span><span class="identifier">geometry</span><span class="special">::</span><span class="identifier">strategy</span><span class="special">::</span><span class="identifier">buffer</span><span class="special">::</span><span class="identifier">join_round</span> <span class="identifier">join_strategy</span><span class="special">;</span>
    <span class="identifier">boost</span><span class="special">::</span><span class="identifier">geometry</span><span class="special">::</span><span class="identifier">strategy</span><span class="special">::</span><span class="identifier">buffer</span><span class="special">::</span><span class="identifier">end_round</span> <span class="identifier">end_strategy</span><span class="special">;</span>
    <span class="identifier">boost</span><span class="special">::</span><span class="identifier">geometry</span><span class="special">::</span><span class="identifier">strategy</span><span class="special">::</span><span class="identifier">buffer</span><span class="special">::</span><span class="identifier">side_straight</span> <span class="identifier">side_strategy</span><span class="special">;</span>

    <span class="comment">// Declare/fill of a multi point</span>
    <span class="identifier">boost</span><span class="special">::</span><span class="identifier">geometry</span><span class="special">::</span><span class="identifier">model</span><span class="special">::</span><span class="identifier">multi_point</span><span class="special">&lt;</span><span class="identifier">point</span><span class="special">&gt;</span> <span class="identifier">mp</span><span class="special">;</span>
    <span class="identifier">boost</span><span class="special">::</span><span class="identifier">geometry</span><span class="special">::</span><span class="identifier">read_wkt</span><span class="special">(</span><span class="string">"MULTIPOINT((3 3),(3 4),(4 4),(7 3))"</span><span class="special">,</span> <span class="identifier">mp</span><span class="special">);</span>

    <span class="comment">// Create the buffer of a multi point</span>
    <span class="identifier">boost</span><span class="special">::</span><span class="identifier">geometry</span><span class="special">::</span><span class="identifier">model</span><span class="special">::</span><span class="identifier">multi_polygon</span><span class="special">&lt;</span><span class="identifier">polygon</span><span class="special">&gt;</span> <span class="identifier">result</span><span class="special">;</span>
    <span class="identifier">boost</span><span class="special">::</span><span class="identifier">geometry</span><span class="special">::</span><span class="identifier">buffer</span><span class="special">(</span><span class="identifier">mp</span><span class="special">,</span> <span class="identifier">result</span><span class="special">,</span>
                <span class="identifier">distance_strategy</span><span class="special">,</span> <span class="identifier">side_strategy</span><span class="special">,</span>
                <span class="identifier">join_strategy</span><span class="special">,</span> <span class="identifier">end_strategy</span><span class="special">,</span> <span class="identifier">point_strategy</span><span class="special">);</span>


    <span class="keyword">return</span> <span class="number">0</span><span class="special">;</span>
<span class="special">}</span>
</pre>
<p>
        </p>
<h6>
<a name="geometry.reference.strategies.strategy_buffer_point_circle.h5"></a>
          <span class="phrase"><a name="geometry.reference.strategies.strategy_buffer_point_circle.output"></a></span><a class="link" href="strategy_buffer_point_circle.html#geometry.reference.strategies.strategy_buffer_point_circle.output">Output</a>
        </h6>
<p>
          <span class="inlinemediaobject"><img src="../../../img/strategies/buffer_point_circle.png" alt="buffer_point_circle"></span>
        </p>
<h6>
<a name="geometry.reference.strategies.strategy_buffer_point_circle.h6"></a>
          <span class="phrase"><a name="geometry.reference.strategies.strategy_buffer_point_circle.see_also"></a></span><a class="link" href="strategy_buffer_point_circle.html#geometry.reference.strategies.strategy_buffer_point_circle.see_also">See
          also</a>
        </h6>
<div class="itemizedlist"><ul class="itemizedlist" style="list-style-type: disc; ">
<li class="listitem">
              <a class="link" href="../algorithms/buffer/buffer_7_with_strategies.html" title="buffer (with strategies)">buffer
              (with strategies)</a>
            </li>
<li class="listitem">
              <a class="link" href="strategy_buffer_point_square.html" title="strategy::buffer::point_square">point_square</a>
            </li>
<li class="listitem">
              <a class="link" href="strategy_buffer_geographic_point_circle.html" title="strategy::buffer::geographic_point_circle">geographic_point_circle</a>
            </li>
</ul></div>
</div>
<table xmlns:rev="http://www.cs.rpi.edu/~gregod/boost/tools/doc/revision" width="100%"><tr>
<td align="left"></td>
<td align="right"><div class="copyright-footer">Copyright © 2009-2021 Barend Gehrels,
      Bruno Lalande, Mateusz Loskot, Adam Wulkiewicz, Oracle and/or its affiliates<p>
        Distributed under the Boost Software License, Version 1.0. (See accompanying
        file LICENSE_1_0.txt or copy at <a href="http://www.boost.org/LICENSE_1_0.txt" target="_top">http://www.boost.org/LICENSE_1_0.txt</a>)
      </p>
</div></td>
</tr></table>
<hr>
<div class="spirit-nav">
<a accesskey="p" href="strategy_buffer_distance_asymmetric.html"><img src="../../../../../../../doc/src/images/prev.png" alt="Prev"></a><a accesskey="u" href="../strategies.html"><img src="../../../../../../../doc/src/images/up.png" alt="Up"></a><a accesskey="h" href="../../../index.html"><img src="../../../../../../../doc/src/images/home.png" alt="Home"></a><a accesskey="n" href="strategy_buffer_point_square.html"><img src="../../../../../../../doc/src/images/next.png" alt="Next"></a>
</div>
</body>
</html>
